﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Procurement
{
    [ActiveRecord]
    public class PurchaseBill : PersistentObjectWithGuid
    {
        #region 供应商ID
        [Property]
        [ValidateNonEmpty]
        public virtual string SupplierID
        {
            get
            {
                return supplierID;
            }
            set
            {
                supplierID = value;
            }
        }
        private string supplierID;
        #endregion

        #region 采购单编号
        [Property]
        [ValidateNonEmpty, ValidateLength(0, 100, "采购单编号超长")]
        public virtual string PurchaseBillCode
        {
            get
            {
                return purchaseBillCode;
            }
            set
            {
                purchaseBillCode = value;
            }
        }
        private string purchaseBillCode;
        #endregion

        #region 日期
        [Property]
        public virtual DateTime PurchaseBillDate
        {
            get
            {
                return purchaseBillDate;
            }
            set
            {
                purchaseBillDate = value;
            }
        }
        private DateTime purchaseBillDate;
        #endregion

        #region 采购人员
        [Property]
        [ValidateLength(0, 100, "采购人员超长")]
        public virtual string Buyer
        {
            get
            {
                return buyer;
            }
            set
            {
                buyer = value;
            }
        }
        private string buyer;
        #endregion

        #region 项目ID
        [Property]
        [ValidateNonEmpty, ValidateLength(0, 40, "项目ID超长")]
        public virtual string ProjectID
        {
            get
            {
                return projectID;
            }
            set
            {
                projectID = value;
            }
        }
        private string projectID;
        #endregion

        #region 币别代码
        [Property]
        [ValidateLength(0, 20, "项目ID超长")]
        public virtual string CurrencyCode
        {
            get
            {
                return currencyCode;
            }
            set
            {
                currencyCode = value;
            }
        }
        private string currencyCode;
        #endregion

        #region 采购订单号
        [Property]
        [ValidateLength(0, 100, "采购订单号超长")]
        public virtual string PurchaseOrderCode
        {
            get
            {
                return purchaseOrderCode;
            }
            set
            {
                purchaseOrderCode = value;
            }
        }
        private string purchaseOrderCode;
        #endregion

        #region 采购订单ID
        [Property]
        [ValidateNonEmpty,ValidateLength(0, 40, "采购订单ID超长")]
        public virtual string PurchaseOrderID
        {
            get
            {
                return purchaseOrderID;
            }
            set
            {
                purchaseOrderID = value;
            }
        }
        private string purchaseOrderID;
        #endregion

        #region 收货单号
        [Property]
        [ValidateLength(0, 100, "收货单号超长")]
        public virtual string MatesReceiptNumber
        {
            get
            {
                return matesReceiptNumber;
            }
            set
            {
                matesReceiptNumber = value;
            }
        }
        private string matesReceiptNumber;
        #endregion

        #region 供应商发票号
        [Property]
        [ValidateLength(0, 50, "供应商发票号超长")]
        public virtual string SupplierInvoiceNumber
        {
            get
            {
                return supplierInvoiceNumber;
            }
            set
            {
                supplierInvoiceNumber = value;
            }
        }
        private string supplierInvoiceNumber;
        #endregion

        #region 发票编号
        [Property]
        [ValidateLength(0, 50, "发票编号超长")]
        public virtual string InvoiceCode
        {
            get
            {
                return invoiceCode;
            }
            set
            {
                invoiceCode = value;
            }
        }
        private string invoiceCode;
        #endregion

        #region 送货日期
        [Property]
        public virtual DateTime DeliverGoodsDate
        {
            get
            {
                return deliverGoodsDate;
            }
            set
            {
                deliverGoodsDate = value;
            }
        }
        private DateTime deliverGoodsDate;
        #endregion

        #region 送货地址
        [Property]
        [ValidateLength(0, 510, "送货地址超长")]
        public virtual string DeliverGoodsAddress
        {
            get
            {
                return deliverGoodsAddress;
            }
            set
            {
                deliverGoodsAddress = value;
            }
        }
        private string deliverGoodsAddress;
        #endregion

        #region 备注
        [Property]
        [ValidateLength(0, 2000, "备注超长")]
        public virtual string Remarks
        {
            get
            {
                return remarks;
            }
            set
            {
                remarks = value;
            }
        }
        private string remarks;
        #endregion

    }
}
